"""
检查数据库表结构
"""
import pymysql

# 连接数据库
conn = pymysql.connect(
    host='127.0.0.1',
    port=33062,
    user='root',
    password='123456',
    database='minxiao',
    charset='utf8mb4'
)

try:
    cursor = conn.cursor()
    
    # 检查 mx_user_info 表结构
    print("=" * 60)
    print("mx_user_info 表结构:")
    print("=" * 60)
    cursor.execute("DESCRIBE mx_user_info")
    for row in cursor.fetchall():
        print(f"{row[0]:20s} {row[1]:30s} {row[2]:5s} {row[3]:5s}")
    
    print("\n" + "=" * 60)
    print("mx_role 表结构:")
    print("=" * 60)
    cursor.execute("DESCRIBE mx_role")
    for row in cursor.fetchall():
        print(f"{row[0]:20s} {row[1]:30s} {row[2]:5s} {row[3]:5s}")
    
finally:
    conn.close()
